package com.lagou.io;

import java.io.InputStream;

public class Resources {
    private static ClassLoaderWrapper classLoaderWrapper = new ClassLoaderWrapper();

    // 根据配置文件的路径，将配置文件加载成字节输入流，存储在内存中
    public static InputStream getResourceAsSteam(String path){
        ClassLoader classLoader = Resources.class.getClassLoader();
        InputStream resourceAsStream = classLoader.getResourceAsStream(path);
        return  resourceAsStream;

    }

    public static Class<?> classForName(String className) throws ClassNotFoundException {
        return classLoaderWrapper.classForName(className, classLoaderWrapper.getClassLoaders(null));
    }


}
